<include file="Public/header"/>
<div class="layui-tab">
<ul class="layui-tab-title">
	<li class="" data-url="<{:U('User/editUser',array('uid'=>$_GET['uid']))}>" onclick="load_url(this)">商户信息</li>
	<li class="" data-url="<{:U('User/userWithdrawal',array('uid'=>$_GET['uid']))}>" onclick="load_url(this)">提现</li>
	<li class="" data-url="<{:U('User/editUserProduct',array('uid'=>$_GET['uid']))}>" onclick="load_url(this)">通道</li>
	<li class="layui-this" data-url="<{:U('User/userRateEdit',array('uid'=>$_GET['uid']))}>" onclick="load_url(this)">费率</li>
</ul>
<div class="layui-tab-content">
	<div class="layui-tab-item layui-show">
		<p class="text-danger" style="padding: 15px;">注：费率为千分位.</p>
			<form class="layui-form" action="" id="rate">
				<input type="hidden" name="userid" value="<{$_GET['uid']}>">
				<table class="table table-hover choosetable">
				<thead>
				<tr>
					<th>接口名称</th>
					<th>充值费率</th>
					<th>封顶费率</th>
				</tr>
				</thead>
				<tbody>
				<volist name="products" id="p">
				<tr>
					<td><{$p.name}></td>
					<td>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="u[<{$p.id}>][feilv]" placeholder="" autocomplete="off" class="layui-input" value="<{$p.feilv}>">
						</div>
					</td>
					<td>
						<div class="layui-input-inline" style="width: 100px;">
							<input type="text" name="u[<{$p.id}>][fengding]" placeholder="" autocomplete="off" class="layui-input" value="<{$p.fengding}>">
						</div>
					</td>
				</tr>
				</volist>
				</tbody>
			</table>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label"></label>
						<button  class="btn btn-primary" lay-submit="submit" lay-filter="save">提交保存</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
</div>
</div>
</form>
<script src="/Public/Front/js/jquery.min.js"></script>
<script src="/Public/Front/js/bootstrap.min.js"></script>
<script src="/Public/Front/js/plugins/peity/jquery.peity.min.js"></script>
<script src="/Public/Front/js/content.js"></script>
<script src="/Public/Front/js/plugins/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['layer', 'form','laydate'], function(){
        var form = layui.form
            ,laydate = layui.laydate
            ,layer = layui.layer;

        //监听提交
        form.on('submit(save)', function(data){
            $.ajax({
                url:"<{:U('User/saveUserRate')}>",
                type:"post",
                data:$('#rate').serialize(),
                success:function(res){
                    if(res.status){
                        layer.alert("编辑成功", {icon: 6},function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }
                }
            });
            return false;
        });
    });

    function load_url(url) {
        var url = $(url).data('url');
        location.href = url;
    }

</script>
</body>
</html>
